<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MiniWebSvr - 轻量级Web服务器</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            background: #f5f7fa;
            padding: 30px;
            max-width: 800px;
            margin: 0 auto;
        }

        .header {
            text-align: center;
            margin-bottom: 40px;
            padding: 30px;
            background: white;
            border-radius: 10px;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        }

        h1 {
            color: #2c3e50;
            margin-bottom: 10px;
            font-size: 2.2rem;
        }

        .header p {
            color: #7f8c8d;
            font-size: 1.1rem;
        }

        .section {
            background: white;
            padding: 25px;
            margin-bottom: 25px;
            border-radius: 10px;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        }

        h2 {
            color: #2c3e50;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid #ecf0f1;
        }

        .endpoint {
            margin-bottom: 20px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 8px;
            border-left: 4px solid #3498db;
        }

        .endpoint h3 {
            color: #2c3e50;
            margin-bottom: 8px;
        }

        .endpoint p {
            color: #7f8c8d;
            margin-bottom: 10px;
        }

        .url {
            display: inline-block;
            background: #3498db;
            color: white;
            padding: 6px 12px;
            border-radius: 4px;
            font-family: 'Courier New', monospace;
            text-decoration: none;
            font-size: 0.9rem;
        }

        .url:hover {
            background: #2980b9;
        }

        .form-group {
            margin-bottom: 15px;
        }

        label {
            display: block;
            margin-bottom: 5px;
            font-weight: 600;
            color: #2c3e50;
        }

        input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 1rem;
        }

        input:focus {
            outline: none;
            border-color: #3498db;
        }

        .submit-btn {
            background: #3498db;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 4px;
            font-size: 1rem;
            cursor: pointer;
            transition: background 0.3s;
        }

        .submit-btn:hover {
            background: #2980b9;
        }

        .footer {
            text-align: center;
            margin-top: 30px;
            color: #7f8c8d;
            font-size: 0.9rem;
        }
    </style>
</head>
<body>
<div class="header">
    <h1>MiniWebSvr</h1>
    <p>基于 Java Socket 编程构建的轻量级 Web 服务器</p>
</div>

<div class="section">
    <h2>可用端点</h2>

    <div class="endpoint">
        <h3>时间服务</h3>
        <p>获取当前服务器时间</p>
        <a href="/time" class="url">/time</a>
    </div>

    <div class="endpoint">
        <h3>回显服务</h3>
        <p>显示请求参数和详细信息</p>
        <a href="/echo?name=谢冈兵&id=222024321072045" class="url">/echo?name=谢冈兵&id=222024321072045</a>
    </div>
</div>

<div class="section">
    <h2>POST 请求测试</h2>
    <form action="/echo" method="post">
        <div class="form-group">
            <label for="name">姓名:</label>
            <input type="text" id="name" name="name" placeholder="请输入您的姓名" required>
        </div>

        <div class="form-group">
            <label for="message">消息:</label>
            <input type="text" id="message" name="message" placeholder="请输入要发送的消息" required>
        </div>

        <button type="submit" class="submit-btn">发送请求</button>
    </form>
</div>

<div class="footer">
    <p>© 2024 MiniWebSvr - 轻量级Java Web服务器</p>
</div>
</body>
</html>